package com.mmgc.shop.plugin

import android.annotation.SuppressLint
import com.flutter_yfree.YFlutterPlugin
import io.flutter.plugin.common.MethodChannel

@SuppressLint("StaticFieldLeak")
class AppPlugin {
    fun register() {
        MethodChannel(YFlutterPlugin.flutterEngine.dartExecutor.binaryMessenger, "AppPlugin").setMethodCallHandler { methodCall, result ->
            val method = methodCall.method
            val arguments = (methodCall.arguments as? Map<*, *>) ?: mapOf<String, Any>()
            if (doApp(method, arguments, result)) return@setMethodCallHandler
            result.notImplemented()
        }
    }
}